refactor to attributes