refactor + stubs