At the moment the main abstractions of the libs operates on `any`. This makes a code not being typesafe. Add generics to increase typesafety.