Jsonize all
Move specific logic to functions
Simplification
Reordering
ff