Use more efficient cycle implementation