re-organised codebase