Refactoring, one method for getting values from JSON arrays added