registry: use custom model for UnitState

Fix #665