Cleanup + unit test in application_controller