More formatting and some rewriting