Removing unused code and cleaning up index/javascript