APT Based Template Code Generator