This if-else statement should perhaps be put in a different method?
What is it's purpose?