Small refactor and reorg