Moved nodes outside if