refactor user interaction into multiple methods