Rewrite base function