refactoring generic components