refactoring; output