Changed multiple if statements to use case instead, reduces unnecessary conditional checks and cleans up