js cleaned up -- kind of