Refactor Problem 28