refactored not-found handling for testability
Merge pull request #7 from bdupras/master

refactored not-found handling for testability