Refactor BaseModel#toJSON()