refactoring for output underway