fix spacing and clean up some JS