little refactoring for Issue#3