generize m2m manage block