fixed module templates
further refactoring
.
.
.