Refactored the code by removing the duplicacy of code of navigation bar and enforced the standards