handle trailing slash gracefully
extract loading helper logic into a service