fn cleanup
depends on misc-data-structures (needs work)