Instance info retrieval and json generator refactored