refactor rest-tests