refactored Command, Db, and Loader