added z-mongo and insecure
added vars
refactored code