Extract local variables to private class methods