Cleaned up code a bit moar