refactor reading/writing config file to BaseCommand