Refactored to allow custom reporters.