Removed source function and refactored PebbleTemplate to be more thread safe