refactored the loading of attributes