Changed respond_to? to respond_to_missing? to be able to get the method object
Restructuracion for sake of readability
Added named groups on regex to check for ghost_query methods