add new instances and cleanup
refine function signatures