refactored extension