Atlassian interview question

I was asked to refactor some code