Parameterised things a bit to give the option to scale to more API levels later.