move code around and ensure nodeids are computed eagerly