protected function enqueue($type)
    {
        $filter = function ($val) use ($type) {
            return in_array($val['type'], array($type, 'both'));
        };

        return function () use ($filter) {
            foreach (array_filter($this->styles, $filter) as $hook) {
                wp_enqueue_style($hook['handle'], $hook['src'], $hook['deps'], $this->version, $hook['cond']);
            }
            foreach (array_filter($this->scripts, $filter) as $hook) {
                wp_enqueue_script($hook['handle'], $hook['src'], $hook['deps'], $this->version, $hook['cond']);
            }
        };
    }