Refactor main entry iteration function