Removed unused code and added more organization