Issue #50 - Refactored duplicated code