Pulling out some common callbacks into named functions.
Working on edit functionality.