refactor attrs methods