Custom variables tidy up

Still need to update examples and test but I'm sure it's fine