split grid building and tile retrieving functionality in two classes