Issue #216 : code refactoring