minor refactoring some code.