contest refactor