Move url path and query logic to class method