Removed useless code and cleaned up code.