Use json instead of class