some small code refactoring (iOS)