Restructured code into different files with module/class definitions