cleanup and view prep