Factor bitmap index implementation and hoist them.