Organized references, fixed infinite loops