Refactoring Connection::updateMapping method

Method got a lot cleaner, logic transferred to MappingTool.