refactored for use with tomcat-all