Rewrite service script