Updated path + query name
cleaned up code