Splitting apart the script to allow later modularity