More cleanup, refactoring, and experimentation.