Refactoring, and add support android to ios