Refactor and cleanup in incidents