APD-7: modularize templates