coding dojo refactor