[Fix] issue #541
Refactoring