contract and extend implementation