Parametrize types to improve type inference