moving functions to a new folder for better testing, changed things to support this