Clean up core functions.