[refactor] Synonym store and build algorithm