Move configuration into a template file and clean it up a bit.