refactored and tested print_config command