Refactoring. Added command "list".