last of chat command refactoring