modularizing populdatedb methods