clean up and added exception handling to the 2 attr classes