refactor js code for request page