Tiny code refactoring and update test code
Tiny code refactoring