refactor the console client