started refactoring display JS