Refactored if-statements to conditionals.