Finished implementation of factory format feature.

Fixed warning regarding the usage of toUpperCase() without locale.