Simplify foreach when parsing argument