moved cluster JS functions to its own files