ios: refactor