refactored generic style