Refactor large parts of client comm structure