Small refactor. Now finished