add some type hints to avoid reflection in some key fns