cleaned up input code

eliminated a superfluous method during the handling of input and added
null pointer checks