Moved the db consolidate logic to its own file; updated the prepare logic to reflect that