Refactor iOS client.