use generics where possible

Change-Id: I4a4e727fa3e27ba921c3888c1938e4835a042bed
Signed-off-by: Simon Scholz <simon.scholz@vogella.com>