Generalize css and js link function