Adding recursive request and refactoring