break into 2 diff js for public