Kata Refactoring code