refactored chat models and views to separated modules