some clock refactoring