Removed unnecessary code and code cleanup.