reorganize and implement json configuration