Debug and Refactoring