replaced output infrastructure with more easily extensible one