Refactor console commands