Initial refactoring of shape creation/mutation functions.