Updating similarity calculator in order to improve performance