Refactor tile validation function to ready it for edge testing