added some XSS prevention

cleaned up some unnecessary code and comments
prevent creation of account with duplicate