refactor console command