did a little bit refactoring.