Re-factored connection layer.