Factor out acrostic code into its own function (DRY)