Move client setup outside of main