Pulling out js, cleaing up a bit