cleaned up singleton implementation