I have been doing this completely wrong. Everything immutable, use the Result monad