Swap method declaration and if statement