Problem 002 refactor