staging_task tests
major refactoring to allow mocking