Cleaned up the code base a bit