Moved configuration logic onto a separate file.