Moved request to function