clean up the code a bit and add getting a user