prep for mocha implementation, small refactoring in app_c