modified singleton-template