refactored chatview module