Updates handling of NodeByIdOrEmpty to use less resources