Dshape refactor