Refactoring for attribute