Moved things to increase readability, also fixed the
one-item-consume-once-only problem