refactored code so that instance is only set when the object is configured, following issue #206
Merge pull request #207 from YannRobert/RefactorToBeClearerSinceIssue206

refactored code so that instance is only set when the object is configured