Improve some ldap querys