small refactor to sdk and equivalent changes to simulator and sample app