Removed unnecessary functions and code