add helper routine for creating latched registers