restructuring for dynamic loading