refactoring tiles