refactor component factories and link to trait