Began refactoring offline tile code