remove obsolete code and reorganize module add also histogram templates