Tools for resolving generic types