migrate stuff to unit tests