Replacing one-liner if's