Small code design changes

Changed:
    Using dependency injection for the whatsapp class