Created new files and organized the functions