Refactor define_request and remove recursive method call