small refactroing + new test (todo)