extract some code