Cleaned up code a little more