refactored generic structure