Added generic types

No more warnings. This project certainly has some spaghetti, no
bolognese or ketchup though. :/