refactored static resource handling