Refactored LogicFlow/Layer to Loop