Removed duplicate extend function