Finish q2. Attempt to refactor