umpteenth refactor