Klarna interview question

Take existing code, point issues and refactor it