Refactor tile rules transform into utils