moved js code to app/