improved security & removed unused code