Move setup code into utils