Moved user input processing to seperate method