Refactor min-elements statement implementations