tests are green but funky refactor