Removed duplicate code.