refactoring and other make nice