Replace brittle features with unit tests