refactored attributes as fields