Refactor the javascript to be cleaner and more maintainable