Removed unused code and variables