Simplify duplicated lines