small style improvement
small js refactoring