Clean if statement in applicatio helper