Fixed more code repetition flaws