These three lines are an exact duplicate of elsewhere - might as well factor it out.