Refactor problem 002.