iFlyChat - rewrite as a class