module foreach with class setting