major re-structuring of codebase