add factory test, but firebase part need to be reviewed to be mocked as the test needs to work without external depandency