Refactoring to use piecutter.