switched to cdx api, generall cleanup