Refactoring the class to remove useless conditions ( else )

* This is my first contribution. I cleared a small piece of code and all tests are passing. :+1: