try to optimize EOS functions