Minor code refactoring
Merge branch 'master' into apply
Add test case