Refactored duplicated