Begin refactoring of pin_create.