minor refactor before cleanup