clean up and comment client-side JS