larger refactoring (separate concerns)