Removed unused variables and functions