moved JSON generation and renamed generator