refactor-rename
add assertion, improve comment
add enhanced segment tree
refactor - make common code - use enhanced one
refactor - remove interface layer