Refactor to a more straightforward stubbing API architecture