refactor of question 1