more flexible static directory handling