added tests and singletone