Removed duplicate code from the project