Big update and unit tests