Refactor - remove duplicate code

Part of the refactoring meant that I created tables for the roman
letters and arabic equivalent numbers. Two for loops were added to allow
the duplicate if blocks to be merged.