Refactored the dist/norm features.