more common refactoring
added centralized debug module