Added Java config and better security