Started adding some type checking in the model