Refactor into an output handler
A naming convention
Working ES output