More clean ups and refactorign on ClientMain to make it easier to understand