partially done with redundancy fixes