Small refactor and clean up