improving code foe elements that are not list ofs