compactifying put method in listview