Refactored code to make templatedStylesheet to accept path