refactor some output