Removed more duplicate code