New code structure and sort chat like in iMessage App