debugging and refactoring in progress