move to external js file