Potter Kata: refactor to correct result