clean up, replace emptylist with nil