restruture of singleton