Refactor Problem 11