Removed duplicate code and unused imports which was causing build failure.