Refactor for remove switch and rise up code legibility