Elastic Path interview question

Refactoring task - had to explain my solution in 2nd technical interview.