Debug Refactor

Refactoring Timer function.