a little of refactoring