gen trade script cleanup