Cleaned up all the code