Making some changes thanks to unit tests