moved some js into its own js file