Refactor Problem 19