Output refactor

Closes #53