finished refactor, back to where I started functionally