refactored
debug