Refactor to extract Vibes middleware into its own module