kill spurious whitespace
make perlcritic happy
use normalized values
drop variables used only once
cosmetics
document debug_message() method