Refactor classes into Chist module