refactoring of the katas