Refactoring http request and rating requests