Refactored partials extraction from the template source