output formatting and filtering