Do a little manual dependency injection.
Convert fdb into local variable, and other cleanups.