modularized; split into per node output