rewrite to more common functions