Cleaned up code a tad