minor refactoring to improve minification