delete submodule
Simplify implementation and add template