refactoring init command.