refactor patch editor. working on pins