Start chopping up humongous terminate function.