Prettified valve control code