Better generic programming style