some pre db work