refactoring to get it to compile in D2010 - does

Compiles in D2010 but compiler bug makes it crash.