refine polymorphic function call