made great restructuring and added ldap authentication