implement Query Extension and helper js