make js functions local and remove css code from it