Define value to use as label for terminal spans
Implement JSON output format and refactor