simplify constraints: from generic to AnyRef