tests green, but code still weird
refactoring