More factoring/code hygiene