refactoring to json file