Refactor Problem 14