reformat plugin structure, moves template into the actual code