simplification, removal of duplicate tests, style changes