Refactor out configuration code, add start of authentication