little code refactoring.

little code refactoring.