Rework of codebase