Refactor Problem3