Refactored switches, if statements and ternary to their own files