Removed duplicate code