tidy up the prepare function
first stab at support for changes that need to see the current value