Some refactoring, parts of JSON