Refactoring of tile related classes