refactor koans