Refactors. Still need to update listview.