Reduce number of queries of module configurations