messy code with finalized 3rd party switching