more work refactor