[IPHONEAPP-642] minor cleanup and refactoring