Add documentation on the toModel function