more extensible code

separate numeral mapping and numeral composition