more foreach, less pointers