begin decoupling impure code
Mostly decouple everything