refactor LDAP