Moving initialization to the top of setup, such that if setup fails, variables are already defined.