refactoring and adding javascript for #54