Extract some UI code into a function.
Extract some variables.
Validate numbers more strictly and replace empty labels with ?.