listview.js: horrible spaghetti