Cleanup unused.
Change scope to help testing
Suppress class cast warning