Removed more duplicate code.