Code refactoring in FromJSON.swift