Refactored the output executor functionality so that it's easy to inherit from and modify.