GUNO: Added some generics. If it works it makes the code a whole lot more readable.