Updated class variables in methods to passed variables for easier testing.