Refactor code to hide private variables.