Restructured code to use subfolders to make system cleaner