refactor data output