wip: more code cleanup