Moved client initialisation into the controller