Add commands message and history; refactoring.