commit before introduce JSON
working variant with JSON serialization
some cleanups
some cleanups