refactor on updates