Removed unused code, Improved performance