Pruning code for better test coverage