Refactors, deals with user input and enhances render