update adapter pattern
add template pattern.