fixing live code refactoring to flatten out callbacks