Refactoring MapperFactory to use switch statement.