Tidy code, make a bit more consistent