made template class more efficient avoiding multiple file get contents calls