Move private logic out of client.