Refactoring to make database generation cleaner/easier going forward.