protected function assertClass($class)
    {
        if (!preg_match('/^([a-zA-Z_]\w*\\\\)*[a-zA-Z_]\w*$/', $class)) {
            throw new \UnexpectedValueException("Can't route to controller '$class': invalid classname");
        }
        
        if (!class_exists($class)) {
            throw new \UnexpectedValueException("Can't route to controller '$class': class not exists");
        }

        $refl = new \ReflectionClass($class);
        $realClass = $refl->getName();
        
        if ($realClass !== $class) {
            throw new \UnexpectedValueException("Can't route to controller '$class': case mismatch with '$realClass'");
        }
    }