refactor capcha