protected function removeDisabledCallbacks(array $config)
    {
        if (!isset($config['callbacks'])) {
            return $config;
        }

        foreach (array('before', 'after') as $position) {
            foreach ($config['callbacks'][$position] as $i => $callback) {
                if ($callback['disabled']) {
                    unset($config['callbacks'][$position][$i]);
                }
                unset($config['callbacks'][$position][$i]['disabled']);
            }
        }

        return $config;
    }