common function is consolidated.

Signed-off-by: godai_0519 <godai0519@gmail.com>