Refactor for Django template parser.