Refactor into tile class