Added some settings and error handling, factored out the configuration to its own object to do things right.