Refactoring for traits