use enum in userinput

and change the parser