cleanup and refactor db initialize scripts