Removed unused functions and other code