debug after refactoring