cleaned up database gen script a bit