move jsonOuput method to its own Json class