Minor refactoring in sample app