Clean up, unification and JSON