Add unit tests and change Observable impl