Code cleanup and removing redundant code.