refactoring: pushed creation of instances to respective elements (json, xml)