markup and a bit of cleanup