added more test for which
refactoring