moved tile related stuff to own class