Feature/reorg and refactor