Refactoring - some chat code moved from MainActivity to Chat.java