Make some rules functions scoped locally to the implementation