Updated to use new block interface instead of delegate.