javascript refactor, font change, and modified index