better way to use with singleton class