Merged 2 if-statements