refactor(dd-lib): refactor code to allow for easy implementation of futureerrors to catch