add iPhone support
some refactor