Refactor code so cssTag/jsTag code can be reused