genral refactoring.