removed duplicate code.