small refactor, fixing some tests