start shifting JS to libraries