replace cond by multimethod