got rid of one-line if and one-line foreach that does not conform to Mediawiki's coding standards