Restructured code into modules