arrange, rewrite and format code