Code cleanup
Tweak for iOS