Rewrite heads method in cfg