Further abstractions, refactors, improvements.