Refactor fallback code