minor cleanups/refactoring