[refac] changed the heap and dispatcher relation in order to use stack allocation

over the heap