singleton func simplified
Merge pull request #2 from massyl/master

singleton func simplified