generic elements refactoring