Minor refactoring & new test case