Optimize/remove some now-useless/redundant code