Added null-check on update method, and removed Pair usage