a legacy kata to refactor