Refactor of some processing of collection options for .clear_expired and .release_all