Refactoring creating of attributed