refactored for apache / node deployment