mapping data with generic type