add destroy + various refactoring
update extend method and fix bug