Small refactor, attempting to fix tests