General retrospective changes and more unit tests