added some null checks
singleton example implemented
sonar improvements