Moved the location of some functions and renamed some files