moved bart build_db code to new script