Restructured code due to modularization