Refactor code for mobile client.
Refactor code for mobile client.