Distance model is abstracted into its own trait.