Moved tile_class code into a role