moving components to javascript