Overhaul codebase