Moved all input functionality to separate file.