Add Cancel button, move `finalElements` from global namespace