Refactor around generic types.