move dll init code back to main body