Refactored configuration into a configurable callback