Add console commands, refactoring.