some cleanup for db etc