nicer code all round