[x][add singleton pattern code]