Cleaned up timer code.