Small refactor in attribute method