split js and templates