Refactor into single-file module/app.