Make distance measures configurable