rewrite rememberAddress function to make dry code