Database switch elimination (#37)
misc stuff