Cleaned up and removed excess code