public function create($type, Closure $callback, $index = null)
{
if (!is_string($type)) {
throw new InvalidArgumentException('type should be a string');
}
if ($index and !is_string($index)) {
throw new InvalidArgumentException('index should be a string');
}
$blueprint = $this->createBlueprint($type, $closure = null, $index);
$blueprint->create();
$callback($blueprint);
$this->build($blueprint);
}