small tidy
slightly refactored