Moved initial config to top of code