refactor invalid function to its own module, sketch mbtiles validator