Removed unnecessary shouldExpand variable