adjusted to work with new sph model schema