cleaned up interaction with ldap a bit