Refactoring Client, and adapting plogg