replace instance variables with @attributes hash