moved user input processing inside class methods