Removed redundant functions and code