attr refactor