refactor to set Debug value