refactored extension way