WiP: refactor version selection