First pass at moving some things to config, begin cleaning up code