Getting around wierd build issue with generics