another refactoring round