Fix for cross-domain + refactor