Converting to unit tests