Added unit tests and abstract implementation.