support singleton and prototype scope