cleanup, code style, code optimizations, jquery update