modularise element query