refactoring a bit to allow for async testing and step testing