Refactoring to use self variables.