Swap to group shape so shape() is only called once