simplify output_manager.cpp and refactor