Refactored if statements out of user class to make code more easily readable