Abstract pinning/connections code