Separated my functions; less main clutter