Supports JSON output and new helperfunction