Refines database build scripts