rewrite devices