refactor answer method