Factor out line commit