minor ordering refactor of front-end js