refactor defining request type