refactor mercator