move type and name above query