Simplify the cycle code