Some clean up and changes to externalize configuration