code refactor on contact list