Rewrote parts of client logic