Removed duplicate code blocks