small refactor + extra test case