Clean up code a bit and use variables