using of similarity macros instead of udf's