Split it into several files, move them into the domain folder, introduce `LdapError` for better control flow.