optimize for tomcat 6/7 work