ctx similarity api refactored