submit answer refactor