refactor commands
add some comments and DB connection config