active record and logging cleanup