Refactor static file handlers.