Refactored class initialisation ...

... to get rid of global variables
This tag has no release notes.