refactoring to account for dynamic loading