first cut at similarity refactor