Improve get art/attr id code and fix auotmated refactor errors