cleaning for template solution
template based first edition, works very bad, maybe there's a bug