Refactor class attributes passed in JSON