Some improvements for singleton