integrate
use function instead of plain codes