beginning to clean up the JS