move logic to Render and re-use in "getClassnameByPath"