Split client and server impl am: a6d6fa3d9d am: 6fc5d41149 am: 6adb27af27

Change-Id: Ia523e1fbdb008fa52f7ac25edfd773a5b1da7f57