Designing and synthesis of heterocyclic systems for studying their antibacterial and antifungal activities