iOS related improvements

see the comments in the commits for more info