minor refactoring/cleanup