refactor clock manager