Update clock and remove some unneeded codes