refactor & make tests work again