End kata refactor