Added a functions.cs file and moved all referenced functions into that file. This gives me some flexibility that i didn't have before.