Removed redundant function for fetching message count
Extracted favourite toggling to separate function