Update with more refactoring and set attributes up in provider and resource