Cleaned up code and removed some unused classes