js cleaned up a bit