Moving logic into extension