Refactoring conditionals and removing test method calls