Add pre/post-script functionality