added tile factory and unit tests for tile factory