cleanup and bugfixing on domain parser