more dynamic generation of JSON