cleaned up CreateDimensionElement method