more general implementation of release selection