Add some cycle time functionality and do some refactoring