debug output does not work well on repl
Push state out to top level fn
Separate database loading and composing.
We only need to load the db once.
Refactor: I like the base case first, exist case last
load bach db separately