minor fiddles and minor refactor