Re-add changes lost in refactor