[UPDATE] extracted query base class.