refactor
cleanup looping over modules/rules