Refactoring scratch utilities to a proper reusable package.