refactor for the client startup