317 - refactored mock/stub main