Refactored Extended version