a module for handling bmeg query