clean up mod_aggregate into a seperate method

also change it to use config.option