Cleaned up imports and code
Refactored client, logout works