Refactoring the 377 client