refactoring, tiler uses no global state now